function [range,speed,angle]  = threedfft(data_radar, N, M, Q, numADCSamples,n_chirps,numRX)
%距离FFT
range_win = hamming(numADCSamples);   %加海明窗
doppler_win = hamming(n_chirps);
range_profile = [];
for k=1:numRX
   for m=1:n_chirps
      temp=data_radar(:,m,k).*range_win;    %加窗函数
      temp_fft_1=fft(temp,N);    %对每个chirp做N点FFT
      range_profile(:,m,k)=temp_fft_1;
   end
end

%多普勒FFT
speed_profile = [];
for k=1:numRX
    for n=1:N
      temp=range_profile(n,:,k).*(doppler_win)';    
      temp_fft_2=fftshift(fft(temp,M));    %对rangeFFT结果进行M点FFT
      speed_profile(n,:,k)=temp_fft_2;  
    end
end

%角度FFT

angle_profile = [];
for n=1:N   
    for m=1:M   
      temp=speed_profile(n,m,:);    
      temp_fft_3=fftshift(fft(temp,Q));    %对2DFFT结果进行Q点FFT
      angle_profile(n,m,:)=temp_fft_3;  
    end
end
    % [range,speed,angle] = [range_profile,speed_profile,angle_profile]
    range = range_profile;
    speed = speed_profile;
    angle = angle_profile;
end